import React from 'react'
import { render } from 'react-dom'
import {
  Route,
  IndexRoute,
  Router,
  hashHistory,
} from 'react-router'
import { App, PreviewPage } from './components/container'
import { HomePage, DashboardPage } from './components/user'
import { PageNotFound } from './components/error'

import './statics/less/style.less'

const routes = (
  <Route path="/" component={App}>
    <IndexRoute component={HomePage} />
    <Route path="/dashboard" component={DashboardPage} />
    <Route path="/preview" component={PreviewPage} />
    <Route path="/404" component={PageNotFound} />
  </Route>
)

render(
  <Router history={hashHistory} routes={routes} />,
  document.getElementById('app')
)